﻿using System;

namespace IniFileManager
{
	/// <summary>
	/// Class representing inner structure of an element
	/// within property defined by library user in ini schema.
	/// </summary>
	internal abstract class IniElementSchema
	{
		/// <summary>
		/// Type of element's value (designed for ini parser, to know what to expect).
		/// </summary>
		internal Type ValueType
		{
			get
			{
				return this.DefaulValue.GetType();
			}
		}
		/// <summary>
		/// Boxed default value of an element into object.
		/// </summary>
		abstract internal object DefaulValue
		{
			get;
		}

		/// <summary>
		/// Tells wheather a value is valid within an ini element schema.
		/// </summary>
		/// <param name="boxedValue">Value boxed in object.</param>
		/// <returns>True if value valid within ini element schema. False if not.</returns>
		abstract internal bool IsValueValidWithin( object boxedValue );

	}
}
